using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools
{
    /// <summary>
    /// <para>Simplify By Straight Lines And Circular Arcs</para>
    /// <para>Simplifies polygon and line features by replacing consecutive line segments  or edges with  fewer line segments or edges. Lines segments and polygon edges are simplified based on a specified maximum allowable offset.  Additionally, circular arcs can be created from consecutive  line segments or polygon edges.</para>
    /// <para>通过将连续的线段或边替换为较少的线段或边来简化面和线要素。线段和多边形边根据指定的最大允许偏移量进行简化。 此外，可以从连续的线段或多边形边创建圆弧。</para>
    /// </summary>    
    [DisplayName("Simplify By Straight Lines And Circular Arcs")]
    public class SimplifyByStraightLinesAndCircularArcs : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SimplifyByStraightLinesAndCircularArcs()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The features to be simplified. Features can be lines or polygons. If using multiple inputs, the features must have the same spatial reference.</para>
        /// <para>要简化的功能。要素可以是直线或面。如果使用多个输入，则要素必须具有相同的空间参考。</para>
        /// </param>
        /// <param name="_max_offset">
        /// <para>Maximum Allowable Offset</para>
        /// <para>The maximum distance the output feature edges can deviate from the input feature shapes. When the Fit to vertices option is chosen for the Fitting Type parameter, the distance is measured between the input vertices and the output feature edges. When the Fit to segments option is chosen, the distance is measured between the input feature edges and the output feature edges.</para>
        /// <para>输出要素边可以偏离输入要素形状的最大距离。为拟合类型参数选择拟合顶点选项时，将测量输入折点与输出要素边之间的距离。选择拟合线段选项时，将测量输入要素边和输出要素边之间的距离。</para>
        /// </param>
        public SimplifyByStraightLinesAndCircularArcs(List<object> _in_features, string? _max_offset)
        {
            this._in_features = _in_features;
            this._max_offset = _max_offset;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Simplify By Straight Lines And Circular Arcs";

        public override string CallName => "edit.SimplifyByStraightLinesAndCircularArcs";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_features, _max_offset, _fitting_type.GetGPValue(), _circular_arcs.GetGPValue(), _max_arc_angle_step, _min_vertex_count, _min_radius, _max_radius, _min_arc_angle, _closed_ends.GetGPValue(), _out_feature_class, _anchor_points, _out_feature_layers];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The features to be simplified. Features can be lines or polygons. If using multiple inputs, the features must have the same spatial reference.</para>
        /// <para>要简化的功能。要素可以是直线或面。如果使用多个输入，则要素必须具有相同的空间参考。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_features { get; set; }


        /// <summary>
        /// <para>Maximum Allowable Offset</para>
        /// <para>The maximum distance the output feature edges can deviate from the input feature shapes. When the Fit to vertices option is chosen for the Fitting Type parameter, the distance is measured between the input vertices and the output feature edges. When the Fit to segments option is chosen, the distance is measured between the input feature edges and the output feature edges.</para>
        /// <para>输出要素边可以偏离输入要素形状的最大距离。为拟合类型参数选择拟合顶点选项时，将测量输入折点与输出要素边之间的距离。选择拟合线段选项时，将测量输入要素边和输出要素边之间的距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Allowable Offset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _max_offset { get; set; }


        /// <summary>
        /// <para>Fitting Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the output feature edges and circular arcs will be fitted to the input feature shapes.</para>
        ///   <para>If Fit to segments is chosen, the Maximum Arc Angle Step and Minimum Number Of Vertices parameters are not available.</para>
        ///   <bulletList>
        ///     <bullet_item>Fit to vertices—The offset gap between the output feature edges and the input feature vertices will be minimized. Output feature edges and curves will be fitted approximately to the input feature vertex positions. This is the default.</bullet_item><para/>
        ///     <bullet_item>Fit to segments—The offset gap between the output feature edges and input feature edges will be minimized. Output edges and curves will be fitted approximately to the positions of the input feature shapes.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何将输出要素边和圆弧拟合到输入要素形状。</para>
        ///   <para>如果选择拟合线段，则最大弧角步长和最小顶点数参数不可用。</para>
        ///   <bulletList>
        ///     <bullet_item>拟合折点—输出要素边与输入要素折点之间的偏移间隙将最小化。输出要素边和曲线将近似拟合到输入要素顶点位置。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>拟合线段—输出要素边和输入要素边之间的偏移间隙将最小化。输出边和曲线将近似拟合到输入特征形状的位置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fitting Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _fitting_type_value _fitting_type { get; set; } = _fitting_type_value._FIT_TO_VERTICES;

        public enum _fitting_type_value
        {
            /// <summary>
            /// <para>Fit to vertices</para>
            /// <para>Fit to vertices—The offset gap between the output feature edges and the input feature vertices will be minimized. Output feature edges and curves will be fitted approximately to the input feature vertex positions. This is the default.</para>
            /// <para>拟合折点—输出要素边与输入要素折点之间的偏移间隙将最小化。输出要素边和曲线将近似拟合到输入要素顶点位置。这是默认设置。</para>
            /// </summary>
            [Description("Fit to vertices")]
            [GPEnumValue("FIT_TO_VERTICES")]
            _FIT_TO_VERTICES,

            /// <summary>
            /// <para>Fit to segments</para>
            /// <para>Fit to segments—The offset gap between the output feature edges and input feature edges will be minimized. Output edges and curves will be fitted approximately to the positions of the input feature shapes.</para>
            /// <para>拟合线段—输出要素边和输入要素边之间的偏移间隙将最小化。输出边和曲线将近似拟合到输入特征形状的位置。</para>
            /// </summary>
            [Description("Fit to segments")]
            [GPEnumValue("FIT_TO_SEGMENTS")]
            _FIT_TO_SEGMENTS,

        }

        /// <summary>
        /// <para>Create circular arcs</para>
        /// <para><xdoc>
        ///   <para>Specifies whether circular arcs will be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Circular arcs will be created. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Circular arcs will not be created.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否创建圆弧。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 将创建圆弧。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会创建圆弧。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create circular arcs")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _circular_arcs_value _circular_arcs { get; set; } = _circular_arcs_value._true;

        public enum _circular_arcs_value
        {
            /// <summary>
            /// <para>CREATE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CREATE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_CREATE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_CREATE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Maximum Arc Angle Step (decimal degrees)</para>
        /// <para>The maximum arc angle step (decimal degrees) that will be used to construct circular arcs. The arc angle defines how wide the visual field can be, for each step, when locating vertices to construct circular curves. The arc angle is the central angle of the candidate curve (the curve that is being constructed). If vertices are found within each maximum arc angle step, a circular arc is constructed. For example, if vertices and edges are sparse, use a large arc angle step. The valid value range is from 2 through 95 decimal degrees. The default is 20 decimal degrees. This parameter is not available if the Fit to segments option is chosen for the Fitting Type parameter.</para>
        /// <para>将用于构造圆弧的最大弧角步长（十进制度）。弧角定义了在定位顶点以构建圆形曲线时，每个步骤的视野可以有多宽。弧角是候选曲线（正在构造的曲线）的中心角。如果在每个最大弧角步长内找到顶点，则构造圆弧。例如，如果顶点和边稀疏，请使用较大的弧角步长。有效值范围为十进制后 2 到 95 位。默认值为 20 十进制度。如果为管接头类型参数选择了“拟合线段”选项，则此参数不可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Arc Angle Step (decimal degrees)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _max_arc_angle_step { get; set; } = 20;


        /// <summary>
        /// <para>Minimum Number Of Vertices</para>
        /// <para>The minimum number of vertices required for a circular arc to be created. The value must be greater than 3. The default is 4. This parameter is not available if the Fit to segments option is chosen for the Fitting Type parameter.</para>
        /// <para>创建圆弧所需的最小顶点数。该值必须大于 3。默认值为 4。如果为管接头类型参数选择了“拟合线段”选项，则此参数不可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Number Of Vertices")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _min_vertex_count { get; set; } = 4;


        /// <summary>
        /// <para>Minimum Radius</para>
        /// <para>The smallest allowable radius for output circular arcs. The value must be greater than 0 and smaller than the value specified for Maximum Radius. If no value is specified, the radius of the output circular arcs will not be checked (default).</para>
        /// <para>输出圆弧的最小允许半径。该值必须大于 0 且小于为“最大半径”指定的值。如果未指定任何值，则不会检查输出圆弧的半径（默认值）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _min_radius { get; set; } = null;


        /// <summary>
        /// <para>Maximum Radius</para>
        /// <para>The largest allowable radius for output circular arcs. The value must be greater than the value specified for Minimum Radius. If no value is specified, the radius of the output circular arcs will not checked (default).</para>
        /// <para>输出圆弧的最大允许半径。该值必须大于为最小半径指定的值。如果未指定任何值，则不会检查输出圆弧的半径（默认值）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _max_radius { get; set; } = null;


        /// <summary>
        /// <para>Minimum Arc Angle (decimal degrees)</para>
        /// <para>The minimum arc angle (decimal degrees) that will be used to construct circular arcs. The minimum arc angle is the smallest allowable central angle in the output circular arcs. If the central angle of any output circular arc is less than this value, it will not be created. The valid value range is from 2 through 360 decimal degrees. The default is 2 decimal degrees.</para>
        /// <para>将用于构造圆弧的最小弧角（十进制度）。最小弧角是输出圆弧中允许的最小中心角。如果任何输出圆弧的中心角小于此值，则不会创建该圆弧。有效值范围为 2 到 360 位小数。默认值为 2 个小数度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Arc Angle (decimal degrees)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _min_arc_angle { get; set; } = 2;


        /// <summary>
        /// <para>Preserve endpoints for closed line</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the endpoints of a closed line will be preserved. A closed line is a line that has coincident end points (loop).</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The endpoints of closed lines will be preserved. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The endpoints of closed lines will not be preserved; they can be moved or deleted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否保留闭合线的终结点。闭合线是具有重合端点（循环）的线。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将保留闭合线的端点。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会保留闭合线的端点;可以移动或删除它们。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve endpoints for closed line")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _closed_ends_value _closed_ends { get; set; } = _closed_ends_value._true;

        public enum _closed_ends_value
        {
            /// <summary>
            /// <para>PRESERVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PRESERVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NOT_PRESERVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NOT_PRESERVE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Anchor Points</para>
        /// <para>The path and name of the feature class that contains anchor points. Anchor points overlay vertices on the input features and indicate that they should not be moved or deleted in the simplify process.</para>
        /// <para>包含锚点的要素类的路径和名称。锚点将折点叠加在输入要素上，并指示在简化过程中不应移动或删除这些折点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Anchor Points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _anchor_points { get; set; } = null;


        /// <summary>
        /// <para>Output Layer Names</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layer Names")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_feature_layers { get; set; }


        public SimplifyByStraightLinesAndCircularArcs SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}